diff options
Diffstat (limited to 'src/routes/player/[player]')
| -rw-r--r-- | src/routes/player/[player]/[profile].svelte | 7 | ||||
| -rw-r--r-- | src/routes/player/[player]/index.svelte | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/routes/player/[player]/[profile].svelte b/src/routes/player/[player]/[profile].svelte index bc6c18d..544d3c4 100644 --- a/src/routes/player/[player]/[profile].svelte +++ b/src/routes/player/[player]/[profile].svelte @@ -1,13 +1,14 @@ <script lang="ts" context="module"> import type { Load } from '@sveltejs/kit' import { loadPack } from '$lib/packs' - import { API_URL } from '$lib/api' + import { fetchApi } from '$lib/api' export const load: Load = async ({ params, fetch }) => { const player: string = params.player const profile: string = params.profile - const data: CleanMemberProfile = await fetch( - `${API_URL}player/${player}/${profile}?customization=true` + const data: CleanMemberProfile = await fetchApi( + `player/${player}/${profile}?customization=true`, + fetch ).then(async r => { const text = await r.text() try { diff --git a/src/routes/player/[player]/index.svelte b/src/routes/player/[player]/index.svelte index a04086d..b95ef8a 100644 --- a/src/routes/player/[player]/index.svelte +++ b/src/routes/player/[player]/index.svelte @@ -1,11 +1,11 @@ <script lang="ts" context="module"> import type { Load } from '@sveltejs/kit' - import { API_URL } from '$lib/api' + import { fetchApi } from '$lib/api' export const load: Load = async ({ params, fetch }) => { const player: string = params.player - const data = await fetch(`${API_URL}player/${player}?customization=true`).then(r => r.json()) + const data = await fetchApi(`player/${player}?customization=true`, fetch).then(r => r.json()) if (!data.player) { return { |
